package com.cdie.myschool.mapper.StudentAbilityMapper;

import com.cdie.myschool.domain.dto.StudentAbilityDTO;
import com.cdie.myschool.domain.entity.Calendar;
import com.cdie.myschool.domain.entity.EnjoyRunningInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 雷金臣199000347
 * @date 2022/10/12 - 20:13
 */
@Mapper
public interface StudentAbilityMapper {
    @Select("select * from calendar where school_year=#{xn} and semester=#{xq}")
    Calendar getCalendar2(StudentAbilityDTO studentAbilityDTO);

    @Select("select count(*) from scholarship where semester_id=#{semesterId} and student_code=#{studentCode}")
    int getScholarship(int semesterId,String studentCode);

    @Select("select count(*) from library_pass_record where semester_id=#{semesterId} and user_id=#{studentCode}")
    int getLibraryPassRecord(int semesterId,String studentCode);

    @Select("select * from enjoy_running_info where semester_id=#{semesterId} and student_id=#{studentId}")
    List<EnjoyRunningInfo> getEnjoyRunningInfo(int semesterId, String studentId);

    @Select("select student_name from student where student_code=#{studentCode}")
    String getStudentName(String studentCode);

}
